﻿using System;
using NLog;

namespace Framework.Infrastructure
{
    /// <summary>
    /// 日志帮助类
    /// </summary>
    public class NLogHelper
    {
        private static Logger logger = LogManager.GetCurrentClassLogger();

        public static void Debug(string message)
        {
            logger.Debug(message);
        }

        public static void Debug(string message, Exception ex)
        {
            logger.Debug(ex, message + " " + ex.Message);
        }

        public static void Info(string message)
        {
            logger.Info(message);
        }

        public static void Info(string message, Exception ex)
        {
            logger.Info(ex, message + " " + ex.Message);
        }

        public static void Warn(string message)
        {
            logger.Warn(message);
        }

        public static void Warn(string message, Exception ex)
        {
            logger.Warn(ex, message + " " + ex.Message);
        }

        public static void Error(string message)
        {
            logger.Error(message);
        }

        public static void Error(string message, Exception ex)
        {
            logger.Error(ex, message + " " + ex.Message);
        }

        public static void Fatal(string message)
        {
            logger.Fatal(message);
        }

        public static void Fatal(string message, Exception ex)
        {
            logger.Fatal(ex, message + " " + ex.Message);
        }
    }
}
